export default 
{
	audPlayer:null,
	//创建播放器
	creatAudioPlayer(src,autoplay = true,loop = true)
	{
		if(!this.audPlayer)
		{
			this.audPlayer = uni.createInnerAudioContext();
			this.audPlayer.autoplay = autoplay;
			this.audPlayer.loop = loop;
			this.audPlayer.src = src;
		}
	},
	
	//播放
	play()
	{
		if(this.audPlayer)
		{
			this.audPlayer.play();
		}
	},
	
	//暂停
	paused()
	{
		if(this.audPlayer)
		{
			this.audPlayer.pause();
		}
	},
	
	//停止播放
	stop()
	{
		if(this.audPlayer)
		{
			this.audPlayer.autoplay = false;
			this.audPlayer.loop = false;
			this.audPlayer.src = "";
			this.audPlayer.stop();
			this.audPlayer.destroy(); //一定要销毁，要不声音释放不了
			this.audPlayer = null;
			console.log("～～·～～～～声音停止～～～～～～～～",this.audPlayer);
		}
	},
}